package p5;

import java.util.Arrays;

/**
 * @author krystal
 * @date 2022/11/10 13:25
 */
public class Demo3 {
    public static void main(String[] args) {
        int[] array={10,20,30,40,50,60,70,80,90};
        //全拷贝
        int[] newArr= Arrays.copyOf(array,9);
        System.out.println(Arrays.toString(newArr));
        //部分拷贝
        int[] newArr1=Arrays.copyOfRange(array,2,5);
        System.out.println(Arrays.toString(newArr1));
    }
}
